<!DOCTYPE html>
<html>
  <head><meta name="generator" content="Hexo 3.9.0">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#33363b">
    <meta name="msapplication-TileColor" content="#33363b">
    
    
    
    
    <meta name="keywords" content="GCU, ACM, Algorithm">
    
    
    <link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png">
    
    
    <link rel="icon" type="image/png" sizes="192x192" href="/favicons/android-chrome-192x192.png">
    
    
    <link rel="icon" type="image/png" sizes="32x32" href="/favicons/favicon-32x32.png">
    
    
    <link rel="icon" type="image/png" sizes="16x16" href="/favicons/favicon-16x16.png">
    
    
    <link rel="mask-icon" href="/favicons/safari-pinned-tab.svg" color="#33363b">
    
    
    <link rel="manifest" href="/favicons/site.webmanifest">
    
    
    <meta name="msapplication-config" content="/favicons/browserconfig.xml">
    
    
    <link rel="alternate" href="/atom.xml" title="GCU-ACM" type="application/atom+xml">
    
    
    <link rel="shortcut icon" type="image/x-icon" href="/favicons/favicon.ico">
    
    
    <link rel="stylesheet" type="text/css" href="/css/normalize.css">
    <link rel="stylesheet" type="text/css" href="/css/index.css">
    
    <link rel="stylesheet" type="text/css" href="/css/sidebar.css">
    
    
<link rel="stylesheet" type="text/css" href="/css/page.css">
<link rel="stylesheet" type="text/css" href="/css/post.css">

    <link rel="stylesheet" type="text/css" href="/css/custom.css">
    <link rel="stylesheet" type="text/css" href="/css/atom-one-dark.css">
    <link rel="stylesheet" type="text/css" href="/css/lightgallery.min.css">
    <script type="text/javascript" src="/js/jquery.min.js"></script>
    <script defer type="text/javascript" src="/js/util.js"></script>
    <script defer type="text/javascript" src="/js/clipboard.min.js"></script>
    <script defer type="text/javascript" src="/js/scrollspy.js"></script>
    <script defer type="text/javascript" src="/js/fontawesome-all.min.js"></script>
    <script defer type="text/javascript" src="/js/lightgallery.min.js"></script>
    <script defer type="text/javascript" src="/js/lg-fullscreen.min.js"></script>
    <script defer type="text/javascript" src="/js/lg-hash.min.js"></script>
    <script defer type="text/javascript" src="/js/lg-pager.min.js"></script>
    <script defer type="text/javascript" src="/js/lg-thumbnail.min.js"></script>
    <script defer type="text/javascript" src="/js/lg-zoom.min.js"></script>
    
    <script defer src="/js/busuanzi.pure.mini.js"></script>
    
    
    <script defer type="text/javascript" src="/js/search.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
      var searchPath = "search.xml";
      if (searchPath.length === 0) {
        searchPath = "search.xml";
      }
      var path = "/" + searchPath;
      searchFunc(path, "search-input", "search-result");
    });
    </script>
    
    
    
    
    <script defer type="text/javascript" src="/js/index.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
      var cb = null;
      var els = $(".post figure.highlight");
      if (els.length) {
        // Enabled Hexo highlight line number.
        $(els).each(function (i, e) {
          $(e).before("<button class=\"copy button\">複製</button>");
        });
        cb = new ClipboardJS("button.copy", {
          "target": function (trigger) {
              // Get target element by DOM API.
              // nextElementSibling is figure,highlight.
              // And following is the sequence of Hexo's internal
              // highlight layout with line number.
              return trigger.nextElementSibling.firstChild.firstChild.firstChild.lastChild.firstChild.firstChild;
          }
        });
      } else {
        // Disabled Hexo highlight line number.
        els = $(".post pre code");
        $(els).each(function (i, e) {
          // Add button before pre, not code.
          $(e).parent().before("<button class=\"copy button\">複製</button>");
        });
        cb = new ClipboardJS("button.copy", {
          "target": function (trigger) {
              // Get target element by DOM API.
              // nextElementSibling is figure,highlight.
              // And following is the sequence of Hexo's internal
              // highlight layout without line number.
              return trigger.nextElementSibling.firstChild;
          }
        });
      }
      cb.on("success", function (e) {
        e.clearSelection();
        var trigger = e.trigger;
        // Change button text as a user tip.
        trigger.innerHTML = "已複製";
        $(trigger).addClass("copied");
        // Change button text back;
        setTimeout(function () {
          trigger.innerHTML = "複製";
          $(trigger).removeClass("copied");
        }, 1500);
      });
    });
    </script>
    
    <script defer type="text/javascript" src="/js/custom.js"></script>
    <title>18-19学年码到成功ACM集训队招新 | GCU-ACM - Talk is cheap,show me your code</title>
  </head>
  <body itemscope itemtype="http://schema.org/WebPage" lang="zh_CN" data-spy="scroll" data-target=".list-group">
    
<header id="header" class="header" style="background: #33363b;">
  <div class="container">
    <div class="header-container">
      <div class="header-title">
        <h1 class="title"><a href="/">GCU-ACM</a></h1>
        <h2 class="subtitle">Talk is cheap,show me your code</h2>
      </div>
      
      <div class="logo">
        <img src="/images/logo.png" alt="logo">
      </div>
      
    </div>
    <nav id="nav" class="nav">
      <a id="nav-toggle" class="nav-toggle" aria-hidden="true"><i class="fas fa-bars" aria-label="切换导航栏"></i></a>
      <ul id="menu" role="menubar" aria-hidden="false">
        
        <li role="menuitem"><a href="/"><i class="fas fa-home"></i><span class="menu-text">首页</span></a></li>
        
        <li role="menuitem"><a href="/archives/"><i class="fas fa-archive"></i><span class="menu-text">归档</span></a></li>
        
        <li role="menuitem"><a href="/categories/"><i class="fas fa-th-list"></i><span class="menu-text">分类</span></a></li>
        
        <li role="menuitem"><a href="/tags/"><i class="fas fa-tags"></i><span class="menu-text">标签</span></a></li>
        
        <li role="menuitem"><a href="/about/"><i class="fas fa-user-edit"></i><span class="menu-text">关于</span></a></li>
        
        <li role="menuitem"><a href="http://gcuacm.gitee.io/new2018"><i class="far fa-hand-rock"></i><span class="menu-text">招新</span></a></li>
        
      </ul>
    </nav>
  </div>
</header>


    <main id="main" class="main">
      <div class="container">
        <div class="main-container">
          <div class="content">
            
<div id="post" class="page">
  
  <article class="article post card" itemscope itemtype="http://schema.org/Article">
    <div class="post-block">
      <link itemprop="mainEntityOfPage" href="http://yoursite.com/2018/12/14/18-19new/">
      <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
       <meta itemprop="name" content="码到成功">
       <meta itemprop="description" content="除非你能在床上赚钱，否则就不要赖在床上">
       <meta itemprop="image" content="/images/avatar.png">
      </span>
      <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
       <meta itemprop="name" content="GCU-ACM">
      </span>
    </div>
    <header class="post-header">
      <h1 class="post-title" itemprop="name headline">18-19学年码到成功ACM集训队招新</h1>
      <div class="post-meta">
        
        <span class="post-date">
          <i class="far fa-calendar-plus"></i><span><time title="post-date" itemprop="dateCreated datePublished" datetime="2018-12-14T19:30:11+08:00">2018-12-14 19:30:11</time></span>
        </span>
        
        
        
        <span class="post-meta-divider divider">|</span>
        
        <span class="post-categories">
          
          <i class="far fa-folder-open"></i><span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/招新/" itemprop="url" rel="index"><span itemprop="name">招新</span></a></span>
        </span>
        
        
        
        
      </div>
    </header>
    <main class="post-main" itemprop="articleBody">
      <p>ACM集训队招新算法考核</p>
<hr>
<p>作者：肖锐</p>
<a id="more"></a>
<h1 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h1><p><strong>本次比赛设置赛题8道，其难度不一，时间长度为2.5小时，按照OI赛制选拔队员。</strong></p>
<h1 id="比赛结果"><a href="#比赛结果" class="headerlink" title="比赛结果"></a>比赛结果</h1><p><img src="/2018/12/14/18-19new/scene4.png" alt="OI排名"></p>
<h1 id="比赛现场"><a href="#比赛现场" class="headerlink" title="比赛现场"></a>比赛现场</h1><p><img src="/2018/12/14/18-19new/scene1.jpg" alt="A9-303"></p>
<p><img src="/2018/12/14/18-19new/scene2.jpg" alt="A9-301"><br>赛后部分题目讲解<br><img src="/2018/12/14/18-19new/scene3.jpg" alt="比赛题目部分讲解"></p>
<h1 id="题目以及题解"><a href="#题目以及题解" class="headerlink" title="题目以及题解"></a>题目以及题解</h1><h2 id="一览"><a href="#一览" class="headerlink" title="一览"></a>一览</h2><table>
<thead>
<tr>
<th style="text-align:left">题目</th>
<th style="text-align:left">难度</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">A 老陈的口算题</td>
<td style="text-align:left">简单</td>
</tr>
<tr>
<td style="text-align:left">B 老陈的校验码</td>
<td style="text-align:left">较简单</td>
</tr>
<tr>
<td style="text-align:left">C 老陈的字符串</td>
<td style="text-align:left">较难</td>
</tr>
<tr>
<td style="text-align:left">D 老陈的七彩石</td>
<td style="text-align:left">难</td>
</tr>
<tr>
<td style="text-align:left">E 老陈的三角形</td>
<td style="text-align:left">较难</td>
</tr>
<tr>
<td style="text-align:left">F 老陈的海岸线</td>
<td style="text-align:left">难</td>
</tr>
<tr>
<td style="text-align:left">G 老陈的日记</td>
<td style="text-align:left">较简单</td>
</tr>
<tr>
<td style="text-align:left">H 老陈的集合</td>
<td style="text-align:left">简单</td>
</tr>
</tbody>
</table>
<h2 id="第一题"><a href="#第一题" class="headerlink" title="第一题"></a>第一题</h2><p><img src="/2018/12/14/18-19new/problem1.JPG"></p>
<h3 id="题解"><a href="#题解" class="headerlink" title="题解"></a>题解</h3><p>直接循环输入a、b、c后判断a+b是否等于c即可。<br><figure class="hljs highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><code class="hljs c++"><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;stdio.h&gt;</span></span><br><span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span><br></span>&#123;<br>    <span class="hljs-keyword">int</span> n;<br>    <span class="hljs-built_in">scanf</span>(<span class="hljs-string">"%d"</span>, &amp;n);<br>    <span class="hljs-keyword">int</span> ans1 = <span class="hljs-number">0</span>,ans2 = <span class="hljs-number">0</span>;<br>    <span class="hljs-keyword">for</span>(<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>;i &lt; n;i ++)<br>    &#123;<br>        <span class="hljs-keyword">int</span> a, b, c;<br>        <span class="hljs-built_in">scanf</span>(<span class="hljs-string">"%d%d%d"</span>, &amp;a, &amp;b, &amp;c);<br>        <span class="hljs-keyword">if</span>(a + b == c)<br>        &#123;<br>            ans1 ++;<br>        &#125;<br>        <span class="hljs-keyword">else</span><br>        &#123;<br>            ans2 ++;<br>        &#125;<br>    &#125;<br>    <span class="hljs-built_in">printf</span>(<span class="hljs-string">"%d %d"</span>,ans1,ans2);<br>    <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;<br>&#125;<br> <br><span class="hljs-comment">/**************************************************************<br>    Problem: 4481<br>    Language: C++<br>    Result: 正确<br>    Time:3 ms<br>    Memory:1080 kb<br>****************************************************************/</span><br></code></pre></td></tr></table></figure></p>
<h2 id="第二题"><a href="#第二题" class="headerlink" title="第二题"></a>第二题</h2><p><img src="/2018/12/14/18-19new/problem2.JPG"></p>
<h3 id="题解-1"><a href="#题解-1" class="headerlink" title="题解"></a>题解</h3><p>对于一级校验码，遍历一遍输入的字符串，统计0-9，A-F的数量。（注意F之后的字母不要算）<br>统计之后将每个数转化成十六进制后形成所要的校验码。<br>对于K&gt;1的情形，重复上面操作即可。</p>
<h2 id="第三题"><a href="#第三题" class="headerlink" title="第三题"></a>第三题</h2><p><img src="/2018/12/14/18-19new/problem3.JPG"></p>
<h3 id="题解-2"><a href="#题解-2" class="headerlink" title="题解"></a>题解</h3><p>我们可以遍历存下A、C、M这三个字母在字符串中出现的位置。<br>对于每一个A的位置，在题目要求的长度范围内找到第一个C。（利用所得的所有C的位置）<br>之后计算这个C到要求长度范围内有几个M。<br>累加即可。<br><strong>注意答案超过int范围。</strong></p>
<h2 id="第四题"><a href="#第四题" class="headerlink" title="第四题"></a>第四题</h2><p><img src="/2018/12/14/18-19new/problem4.JPG"></p>
<h3 id="题解-3"><a href="#题解-3" class="headerlink" title="题解"></a>题解</h3><p>对于现在有的石头和需要的石头，我们可以相减一下得到还需要多少个或者多了多少个这种石头。</p>
<p>遇到需要补充的石头直接从离它最近的高等级石头开始砸起，计数即可。<br>（对于次数可以先预算一下。例如一块紫色石头能砸出多少个红色石头，要砸多少次之类，加快速度）</p>
<h2 id="第五题"><a href="#第五题" class="headerlink" title="第五题"></a>第五题</h2><p><img src="/2018/12/14/18-19new/problem5.jpg"></p>
<h3 id="题解-4"><a href="#题解-4" class="headerlink" title="题解"></a>题解</h3><p>计算三角形三边的长度。（两点间距离）<br>如果三边都是非整数那么肯定不能让三角形变成符合要求的三角形。<br>如果三边都是整数且不一样，那么就已经符合要求了。<br>如果有两边一样或者有两边不是整数，那么我们需要判断是整数的那条边是否是1。如果是，那么就无法得到符合要求的三角形；否则可以。（利用三角形两边之和大于第三边可以得到不存在）<br>如果有两边是整数，判断两边之中大者是不是1即可。（同上判断）</p>
<h2 id="第六题"><a href="#第六题" class="headerlink" title="第六题"></a>第六题</h2><p><img src="/2018/12/14/18-19new/problem6.JPG"></p>
<h3 id="题解-5"><a href="#题解-5" class="headerlink" title="题解"></a>题解</h3><p>利用bfs/dfs算法可以解决，重点在边长的计算。（不详述）</p>
<h2 id="第七题"><a href="#第七题" class="headerlink" title="第七题"></a>第七题</h2><p><img src="/2018/12/14/18-19new/problem7.jpg"></p>
<h3 id="题解-6"><a href="#题解-6" class="headerlink" title="题解"></a>题解</h3><p>本题两个问题：判断日期是否合法，判断日期大小<br>是否合法<code>（yy/mm/dd）</code>：<br>注意判断dd是否在对应月份的天数内。mm不能超过12。注意判断闰年，注意负数。<br>判断日期大小：<br>年份小的必定小，年份一样看月份，月份一样看日。<br>注意判断日期合法后才能判断大小。</p>
<figure class="hljs highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br></pre></td><td class="code"><pre><code class="hljs c++"><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;stdio.h&gt;</span></span><br> <br><span class="hljs-keyword">int</span> mon[<span class="hljs-number">1000000</span>] = &#123;<span class="hljs-number">0</span>,<span class="hljs-number">31</span>,<span class="hljs-number">28</span>,<span class="hljs-number">31</span>,<span class="hljs-number">30</span>,<span class="hljs-number">31</span>,<span class="hljs-number">30</span>,<span class="hljs-number">31</span>,<span class="hljs-number">31</span>,<span class="hljs-number">30</span>,<span class="hljs-number">31</span>,<span class="hljs-number">30</span>,<span class="hljs-number">31</span>&#125;;<br><span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span><br></span>&#123;<br>    <span class="hljs-keyword">int</span> n;<br>    <span class="hljs-built_in">scanf</span>(<span class="hljs-string">"%d"</span>, &amp;n);<br>    <span class="hljs-keyword">int</span> maxy = <span class="hljs-number">9999999</span>,maxm = <span class="hljs-number">9999999</span>,maxd = <span class="hljs-number">9999999</span>;<br>    <span class="hljs-keyword">int</span> yy,mm,dd;<br>    <span class="hljs-keyword">int</span> count = <span class="hljs-number">0</span>;<br>    <span class="hljs-keyword">for</span>(<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>;i &lt; n;i ++)<br>    &#123;  <br>        <span class="hljs-built_in">scanf</span>(<span class="hljs-string">"%d/%d/%d"</span>,&amp;yy,&amp;mm,&amp;dd);<br> <br>        <span class="hljs-keyword">int</span> flag = <span class="hljs-number">0</span>;<br>         <br>        <span class="hljs-keyword">if</span>(yy % <span class="hljs-number">400</span> == <span class="hljs-number">0</span> || (yy % <span class="hljs-number">100</span> != <span class="hljs-number">0</span> &amp;&amp; yy % <span class="hljs-number">4</span> == <span class="hljs-number">0</span>)) <br>        &#123;<br>            flag = <span class="hljs-number">1</span>;<br>            mon[<span class="hljs-number">2</span>] ++;<br>        &#125;<br> <br>        <span class="hljs-keyword">if</span>(mm &lt; <span class="hljs-number">1</span> || mm &gt; <span class="hljs-number">12</span> || !(dd &gt;= <span class="hljs-number">1</span> &amp;&amp; mon[mm] &gt;= dd))<br>        &#123;<br>            count ++;<br>            <span class="hljs-keyword">if</span>(flag == <span class="hljs-number">1</span>)<br>            &#123;<br>                mon[<span class="hljs-number">2</span>] --;<br>            &#125;<br>            <span class="hljs-keyword">continue</span>;<br>        &#125;<br> <br>        <span class="hljs-keyword">if</span>(flag == <span class="hljs-number">1</span>)<br>        &#123;<br>            mon[<span class="hljs-number">2</span>] --;<br>        &#125;<br>         <br>        <span class="hljs-keyword">if</span>(maxy &gt; yy)<br>        &#123;<br>            maxy = yy;<br>            maxm = mm;<br>            maxd = dd;<br>        &#125;<br>        <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span>(maxy == yy &amp;&amp; maxm &gt; mm)<br>        &#123;<br>            maxm = mm;<br>            maxd = dd;<br>        &#125;<br>        <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span>(maxy == yy &amp;&amp; maxm == mm &amp;&amp; maxd &gt; dd)<br>        &#123;<br>            maxd = dd;<br>        &#125;<br>    &#125;<br>    <span class="hljs-built_in">printf</span>(<span class="hljs-string">"%d/%d/%d\n"</span>,maxy,maxm,maxd);<br>    <span class="hljs-built_in">printf</span>(<span class="hljs-string">"%d error(s)"</span>,count);<br> <br>    <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;<br>&#125;<br><span class="hljs-comment">/**************************************************************<br>    Problem: 4487<br>    Language: C++<br>    Result: 正确<br>    Time:36 ms<br>    Memory:4984 kb<br>****************************************************************/</span><br></code></pre></td></tr></table></figure>
<h2 id="第八题"><a href="#第八题" class="headerlink" title="第八题"></a>第八题</h2><p><img src="/2018/12/14/18-19new/problem8.jpg"></p>
<h3 id="题解-7"><a href="#题解-7" class="headerlink" title="题解"></a>题解</h3><p>可以使用一个数组将输入的所有数放在一个数组里后排序，每输出一个数检查是否是上一个输出的数就行了。<br>坑点：题目写着<strong>“均不超过1000”，但可能是一个很大的负数，所以这题要使用long long来存数据才能通过</strong>，否则最多92分。<br>如果使用C++，set会很便利。<br><figure class="hljs highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br></pre></td><td class="code"><pre><code class="hljs c++"><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;stdio.h&gt;</span></span><br><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;set&gt;</span></span><br><span class="hljs-comment">/*<br> *set的含义是集合，它是一个有序的容器，里面的元素都是排序好的，支持插入，删除，查找等操作，就像一个集合一样。<br> *所有的操作的都是严格在logn时间之内完成，效率非常高。<br> *set容器中的值都是唯一的，即不能再插入一个容器中已经有的值。<br> */</span><br><span class="hljs-keyword">using</span> <span class="hljs-keyword">namespace</span> <span class="hljs-built_in">std</span>;<br> <br><span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span><br></span>&#123;<br>    <span class="hljs-built_in">set</span>&lt;<span class="hljs-keyword">long</span> <span class="hljs-keyword">long</span>&gt; s; <span class="hljs-comment">//创建一个空的set容器，里面元素的类型为long long</span><br>    <span class="hljs-keyword">int</span> n, m;<br>    <span class="hljs-built_in">scanf</span>(<span class="hljs-string">"%d%d"</span>, &amp;n, &amp;m);<br>    <span class="hljs-keyword">long</span> <span class="hljs-keyword">long</span> t;<br>    <span class="hljs-keyword">for</span>(<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>;i &lt; n;i ++)<br>    &#123;<br>        <span class="hljs-built_in">scanf</span>(<span class="hljs-string">"%lld"</span>, &amp;t);<br>        s.insert(t); <span class="hljs-comment">//把t插入到容器中，容器中没有这个值的话成功插入，否则插入失败。</span><br>    &#125;<br>    <span class="hljs-keyword">for</span>(<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>;i &lt; m;i ++)<br>    &#123;<br>        <span class="hljs-built_in">scanf</span>(<span class="hljs-string">"%lld"</span>, &amp;t);<br>        s.insert(t);<br>    &#125;<br> <br>    <span class="hljs-built_in">set</span>&lt;<span class="hljs-keyword">long</span> <span class="hljs-keyword">long</span>&gt;::iterator itr;<br> <br>    <span class="hljs-comment">//遍历set，因为set是有序，唯一的，所以直接输出就是答案</span><br>    <span class="hljs-keyword">for</span>(itr = s.begin();itr != s.end();itr ++) <br>    &#123;<br>        <span class="hljs-built_in">printf</span>(<span class="hljs-string">"%lld "</span>,*itr);<br>    &#125;<br> <br>    <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;<br>&#125;<br> <br><span class="hljs-comment">/**************************************************************<br>    Problem: 4488<br>    Language: C++<br>    Result: 正确<br>    Time:3 ms<br>    Memory:1204 kb<br>****************************************************************/</span><br></code></pre></td></tr></table></figure></p>
<h1 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h1><p>本次比赛举办得较好，有力得促进了各参赛者的编程水平以及提高其编程积极性。<br>感谢出题人以及队内管理人员的付出。<br><strong>2018即将过去，迎来2019，在新一年里，集训队要争取更好成绩，push</strong><br><img src="/2018/12/14/18-19new/zongjie.JPG" alt></p>

    </main>
    <footer class="post-footer">
      
    </footer>
  </article>
  
  
  <nav class="page-nav">
    <div class="page-nav-next page-nav-item">
      
      <a href="/2018/12/07/18lanqiaobei/" rel="next" title="2018年蓝桥杯校内题选讲"><i class="fas fa-angle-left"></i><span class="nav-title">2018年蓝桥杯校内题选讲</span></a>
      
    </div>
    <div class="page-nav-prev page-nav-item">
      
      <a href="/2019/03/13/190313/" rel="prev" title="必要知识培训"><span class="nav-title">必要知识培训</span><i class="fas fa-angle-right"></i></a>
      
    </div>
  </nav>
  
  
  

<div class="comments" id="comments">
  
  
  <div id="vcomments" class="vcomments"></div>
  <script defer src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
  <script defer src="//unpkg.com/valine/dist/Valine.min.js"></script>
  <script type="text/javascript">
  $(document).ready(function () {
    new Valine({
      "el": "#vcomments",
      "appId": "9X1ViI1Sxnb7PFU97Od7SyUu-gzGzoHsz",
      "appKey": "FElrWSPz5YJXJ0PvokRFJDyu",
      "verify": "true",
      "notify": "true",
      "avatar": "mp",
      "meta": ["nick", "mail", "link"],
      "pageSize": 10,
      "lang": "zh-cn",
      "visitor": "false",
      "highlight": "true",
      "placeholder": "😎看了这么多，不想说点什么嘛😉(如果留有邮箱，当被回复时可收到邮件提醒哦)",
      "avatarForce": "false"
    });
  });
  </script>
  
  
</div>



  
</div>

          </div>
          
          
          
<aside class="sidebar" id="sidebar" style="background: url(/images/background.png);">
  
  <div class="search">
    <div class="form-group">
      <i class="fas fa-search"></i><input type="search" id="search-input" name="q" results="0" placeholder="搜索" class="form-control">
    </div>
  </div>
  <div class="search-result-box" id="search-result"></div>
  
  
<div class="info sidebar-item" id="info">
  
  <img class="author-avatar" src="/images/avatar.png" alt="码到成功">
  
  <h1 class="author-name">码到成功</h1>
  <h2 class="author-description">除非你能在床上赚钱，否则就不要赖在床上</h2>
  <div class="site-count">
    
    
    
    
    <div class="archives-count count-block">
      <div class="site-count-title">归档</div>
      <div><a href="/archives/">25</a></div>
    </div>
    
    
    
    <div class="categories-count count-block">
      <div class="site-count-title">分类</div>
      <div><a href="/categories/">4</a></div>
    </div>
    
    
    
    <div class="tags-count count-block">
      <div class="site-count-title">标签</div>
      <div><a href="/tags/">26</a></div>
    </div>
    
    
    
    
    
    
  </div>
  
  <div class="rss">
    <a class="rss-link button sidebar-item" href="/atom.xml"><i class="fas fa-rss"></i>RSS</a>
  </div>
  
</div>


  <div class="sidebar-sticky">
    
    
    
    
    
    <hr>
    <div class="post-toc sidebar-item" id="toc-div">
      <div><i class="fas fa-list-ol"></i>文章目录</div>
      <div class="post-toc-content"><ol class="list-group toc"><li class="toc-item toc-level-1"><a class="list-group-item toc-link" href="#简介"><span class="toc-text">简介</span></a></li><li class="toc-item toc-level-1"><a class="list-group-item toc-link" href="#比赛结果"><span class="toc-text">比赛结果</span></a></li><li class="toc-item toc-level-1"><a class="list-group-item toc-link" href="#比赛现场"><span class="toc-text">比赛现场</span></a></li><li class="toc-item toc-level-1"><a class="list-group-item toc-link" href="#题目以及题解"><span class="toc-text">题目以及题解</span></a><ol class="list-group toc-child"><li class="toc-item toc-level-2"><a class="list-group-item toc-link" href="#一览"><span class="toc-text">一览</span></a></li><li class="toc-item toc-level-2"><a class="list-group-item toc-link" href="#第一题"><span class="toc-text">第一题</span></a><ol class="list-group toc-child"><li class="toc-item toc-level-3"><a class="list-group-item toc-link" href="#题解"><span class="toc-text">题解</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="list-group-item toc-link" href="#第二题"><span class="toc-text">第二题</span></a><ol class="list-group toc-child"><li class="toc-item toc-level-3"><a class="list-group-item toc-link" href="#题解-1"><span class="toc-text">题解</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="list-group-item toc-link" href="#第三题"><span class="toc-text">第三题</span></a><ol class="list-group toc-child"><li class="toc-item toc-level-3"><a class="list-group-item toc-link" href="#题解-2"><span class="toc-text">题解</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="list-group-item toc-link" href="#第四题"><span class="toc-text">第四题</span></a><ol class="list-group toc-child"><li class="toc-item toc-level-3"><a class="list-group-item toc-link" href="#题解-3"><span class="toc-text">题解</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="list-group-item toc-link" href="#第五题"><span class="toc-text">第五题</span></a><ol class="list-group toc-child"><li class="toc-item toc-level-3"><a class="list-group-item toc-link" href="#题解-4"><span class="toc-text">题解</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="list-group-item toc-link" href="#第六题"><span class="toc-text">第六题</span></a><ol class="list-group toc-child"><li class="toc-item toc-level-3"><a class="list-group-item toc-link" href="#题解-5"><span class="toc-text">题解</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="list-group-item toc-link" href="#第七题"><span class="toc-text">第七题</span></a><ol class="list-group toc-child"><li class="toc-item toc-level-3"><a class="list-group-item toc-link" href="#题解-6"><span class="toc-text">题解</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="list-group-item toc-link" href="#第八题"><span class="toc-text">第八题</span></a><ol class="list-group toc-child"><li class="toc-item toc-level-3"><a class="list-group-item toc-link" href="#题解-7"><span class="toc-text">题解</span></a></li></ol></li></ol></li><li class="toc-item toc-level-1"><a class="list-group-item toc-link" href="#总结"><span class="toc-text">总结</span></a></li></ol></div>
    </div>
    
    
    
    <hr>
    <div class="social-link sidebar-item">
      <div><i class="far fa-address-card"></i>社交链接<p></p></div>
      <ul>
        
        <li><i class="fas fa-envelope"></i><a href="mailto:1239776759@qq.com" target="_blank">E-Mail</a></li>
        
      </ul>
    </div>
    
    
    <hr>
    <div class="blogroll sidebar-item">
      <div><i class="fas fa-link"></i>友情链接</div>
      <ul>
        
        <li><i class="fas fa-link"></i><a href="https://oi-wiki.org/" target="_blank">oi-wiki</a></li>
        
        <li><i class="fas fa-link"></i><a href="https://ac.nowcoder.com/acm/contest/vip-index" target="_blank">牛客竞赛</a></li>
        
        <li><i class="fas fa-link"></i><a href="http://fzcoj.hustoj.com" target="_blank">FZCOJ</a></li>
        
        <li><i class="fas fa-link"></i><a href="https://vjudge.net/article/187" target="_blank">kuangbin带你飞</a></li>
        
        <li><i class="fas fa-link"></i><a href="http://exp-blog.com/2018/06/28/pid-38/" target="_blank">POJ试题分类</a></li>
        
        <li><i class="fas fa-link"></i><a href="https://blog.csdn.net/hbhszxyb/article/details/19845559" target="_blank">OJ(Online Judge)系统及ACM测试题库大全</a></li>
        
      </ul>
    </div>
    
  </div>
</aside>


          
        </div>
      </div>
    </main>
    
<footer id="footer" class="footer" style="background: #33363b;">
  <div class="container">
    <div class="back-to-top">
      <button id="back-to-top"><i class="fas fa-angle-double-up" aria-label="回到顶部"></i></button>
    </div>
    <div class="footer-container">
      <div class="footer-left">
        <div class="copyright">
          <span class="author">码到成功</span><span class="year"><i class="far fa-copyright"></i>2020</span>
        </div>
        
        <div class="busuanzi">
          <span id="busuanzi_container_site_pv"><i class="fas fa-eye" aria-label="站点点击量" aria-hidden="false"></i><span id="busuanzi_value_site_pv"></span></span><span id="busuanzi_container_site_uv"><i class="fas fa-user" aria-label="站点用户数" aria-hidden="false"></i><span id="busuanzi_value_site_uv"></span></span><span id="busuanzi_container_page_pv"><i class="far fa-file-alt"></i><span id="busuanzi_value_page_pv" aria-label="页面点击量" aria-hidden="false"></span></span>
        </div>
        
      </div>
      <div class="footer-right">
        <div class="custom-info">
          
          托管于<i class="fab fa-github-alt"></i><a href="https://gitee.com/help/articles/4136" target="_blank">Gitee Pages</a>
          
        </div>
        <div class="powered-by">
          由 <a href="https://hexo.io/" target="_blank">Hexo</a> 强力驱动 | 主题 <a href="https://github.com/AlynxZhou/hexo-theme-aria/" target="_blank">ARIA</a>
        </div>
      </div>
    </div>
  </div>
</footer>


  </body>
</html>
